package controller

import (
	"think/common"
	"net/http"
)

// IndexController 首页控制器
 type IndexController struct {
	common.Controller
}

// Index 首页方法
func (c *IndexController) Index(w http.ResponseWriter, r *http.Request) {
	c.Success(w, map[string]string{
		"message": "Welcome to ThinkGo Framework",
		"version": "1.0.0",
	})
}

// Hello 示例方法
func (c *IndexController) Hello(w http.ResponseWriter, r *http.Request) {
	name := r.URL.Query().Get("name")
	if name == "" {
		name = "World"
	}
	c.Success(w, map[string]string{
		"greeting": "Hello, " + name + "!",
	})
}